<template>
  <div class="layout sub-main">
    <Nav></Nav>
    <Header></Header>
    <div class="main" style="margin-bottom: 100px">
      <router-view></router-view>
    </div>
    <Footer></Footer>
  </div>
</template>

<script>
import Nav from "@/components/commons/Nav";
import Header from "@/components/commons/Header";
import Footer from "@/components/commons/Footer";
import router from "@/router";
import {onMounted, ref} from "vue";
//获取注册的全局属性或方法
import { getCurrentInstance } from "vue";
export default {
  name: "layout",
  setup(){

    let isShow = ref(router.currentRoute.value.meta.show)
    //获取注册的全局属性或方法
    // onMounted(()=>{
    //   getCurrentInstance().appContext.config.globalProperties.openLoading()
    // })

    onMounted(() => {
      isShow = router.currentRoute.value.meta.show
      console.log(isShow);
    })
    return {
      isShow
    }
  },
  components: {
    Nav,
    Header,
    Footer
  }
}
</script>

<style scoped>
  .layout {
    height: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
  }
  .main {
    flex: 1;
  }
</style>
